]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
IconGrid: don't ask for the children list when the number is enough
authorGiovanni Campagna <gcampagna@src.gnome.org>
Wed, 20 Feb 2013 16:02:34 +0000 (17:02 +0100)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Tue, 6 Aug 2013 14:08:36 +0000 (16:08 +0200)
Clutter keeps the number of children cached, while the list must be
built every time.

js/ui/iconGrid.js

index e26b6f1f387cfeecb16524eb103c4a0656145346..416e659eda1da01b7cdccdddf824e85cc53a8684 100644 (file)
@@ -204,10 +204,10 @@ const IconGrid = new Lang.Class({
             // later we'll allocate as many children as fit the parent
             return;
 
-        let children = this._grid.get_children();
+        let nChildren = this._grid.get_n_children();
         let nColumns = this._colLimit ? Math.min(this._colLimit,
-                                                 children.length)
-                                      : children.length;
+                                                 nChildren)
+                                      : nChildren;
         let totalSpacing = Math.max(0, nColumns - 1) * this._spacing;
         // Kind of a lie, but not really an issue right now.  If
         // we wanted to support some sort of hidden/overflow that would